![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
larvitdbmigration
Advanced tools
This is used to keep track of the database structure, and update it when need be via deploys.
Supported databases:
A table/index by default called db_version will be created, containing a single integer.
Scripts will be placed by default in process.cwd()/dbmigration/.js
Each migration script will be ran, and the db_version increased, until no more migration scripts exists.
npm i --save larvitdbmigration
In your application startup script, do something like this:
'use strict';
const DbMigration = require('larvitdbmigration'),
options = {},
db = require('larvitdb');
let dbMigration;
db.setup({
'host': '127.0.0.1',
'user': 'foo',
'password': 'bar',
'database': 'baz'
});
options.dbType = 'larvitdb';
options.dbDriver = db;
options.tableName = 'db_version'; // Optional - used as index name for elasticsearch
options.migrationScriptsPath = './dbmigration'; // Optional
dbMigration = new DbMigration(options);
dbMigration.run(function (err) {
if (err) throw err;
// Now database is migrated and ready for use!
});
'use strict';
const elasticsearch = require('elasticsearch'),
DbMigration = require('larvitdbmigration'),
options = {},
es = new elasticsearch.Client({'host': '127.0.0.1:9200'});
let dbMigration;
options.dbType = 'elasticsearch';
options.dbDriver = es;
options.tableName = 'db_version'; // Optional - used as index name
options.migrationScriptsPath = './dbmigration'; // Optional
dbMigration = new DbMigration(options);
dbMigration.run(function (err) {
if (err) throw err;
// Now database is migrated and ready for use!
});
Lets say the current database have a table like this:
CREATE TABLE bloj (nisse int(11));
And in the next deploy we'd like to change the column name "nisse" to "hasse". For this you can do one of two methods:
Create the file process.cwd()/migrationScriptsPath/1.js with this content:
'use strict';
exports = module.exports = function (cb) {
const db = this.options.dbDriver;
db.query('ALTER TABLE bloj CHANGE nisse hasse int(11);', cb);
};
Create the file process.cwd()/migrationScriptsPath/1.js with this content:
'use strict';
exports = module.exports = function (cb) {
const es = this.options.dbDriver;
es.indices.putMapping({
'index': 'foo',
'type': 'bar',
'body': {
'bar': {
'properties': {
'names': {
'type': 'string',
'position_increment_gap': 100
}
}
}
}
}, cb);
};
IMPORTANT! SQL files will be ignored if a .js file exists.
Create the file process.cwd()/migrationScriptsPath/1.sql with this content:
ALTER TABLE bloj CHANGE nisse hasse int(11);
Tadaaa! Now this gets done once and the version will be bumped to 1. If you then create a script named "2.js" or "2.sql" you might guess what happends. :)
FAQs
node.js database migration tool
The npm package larvitdbmigration receives a total of 194 weekly downloads. As such, larvitdbmigration popularity was classified as not popular.
We found that larvitdbmigration demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.